#ifndef SETTINGWIDGET_H
#define SETTINGWIDGET_H

#include "Setting_General.h"
#include "Setting_About.h"
#include "Setting_Feedback.h"
#include "Setting_Memory.h"
#include "../BaseWidgets/FramelessWidget.h"
#include "BaseWidgets_global.h"

#include <QLabel>
#include <QPushButton>
#include <QFrame>
#include <QButtonGroup>
#include <QStackedWidget>
#include <QHBoxLayout>
#include <QVBoxLayout>

namespace UserManagementSystem {
class BASEWIDGETS_EXPORT SettingWidget : public FramelessWidget
{
public:
    SettingWidget(QWidget* parent=nullptr);

signals:

public slots:
    ///@brief 通用按钮点击
    void On_General_Btn_Clicked();

    ///@brief 存储按钮点击
    void On_Memory_Btn_Clicked();

    ///@brief 反馈按钮点击
    void On_Feedback_Btn_Clicked();

    ///@brief 关于按钮点击
    void On_About_Btn_Clicked();

private:

    ///@brief 绘制圆角
    virtual void paintEvent(QPaintEvent *event) override;

    ///@brief 初始化样式
    void InitDefaultStyle();

    /// @brief 初始化布局
    void InitDefaultLayout();

    ///@brief 信号槽绑定
    void BindSignalAndSlot();

private:
    ///@brief 一个主布局
    QVBoxLayout* m_mainLayout=nullptr;

    ///@brief 一个子布局放下面的窗口
    QHBoxLayout* m_subLayout=nullptr;

    ///@brief 窗口label
    QLabel m_titleLabel;

    ///@brief 关闭按钮
    QPushButton* m_closeBtn=nullptr;

    ///@brief 横线
    QFrame m_HLine;

    ///@brief 竖线
    QFrame m_VLine;

    ///@brief 左侧的按钮窗口
    QVBoxLayout * m_leftBtnsLayout=nullptr;

    ///@brief 按钮组
    QButtonGroup* m_btnsGroup=nullptr;

    ///@brief 4个按钮
    QPushButton* m_generalBtn=nullptr;
    QPushButton* m_memoryBtn=nullptr;
    QPushButton* m_feedbackBtn=nullptr;
    QPushButton* m_aboutBtn=nullptr;

    ///@brief 右侧一个内容窗口
    QStackedWidget* m_stackedContentWidget=nullptr;

    ///@brief icon资源加载
    QIcon m_closeBtnIcon;


private:
    //按钮对应的窗口
    ///@brief 通用窗口
    UserManagementSystem::Setting_General* m_generalWidget=nullptr;

    ///@brief 存储窗口
    UserManagementSystem::Setting_Memory* m_memoryWidget=nullptr;

    ///@brief 反馈窗口
    UserManagementSystem::Setting_Feedback* m_feedBackWidget=nullptr;

    ///@brief 关于窗口
    UserManagementSystem::Setting_About* m_aboutWidget=nullptr;
};
}



#endif // SETTINGWIDGET_H
